package cn.usain.controller;

import cn.usain.entity.Products;
import cn.usain.service.ProductsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/products")
public class ProductsController {
    @Autowired
    private ProductsService productsService;

    @GetMapping("/getProducts")
    public List<Products> getProducts() {
        return productsService.getProducts();
    }
}
